﻿namespace Bigway.Common.Utils;

public static class RandomCodeGenerator
{
    public static string[] Generate(int length, int count, string chars)
    {
        var random = new Random();
        var strings = new string[count];
        for (var i = 0; i < count; i++)
        {
            strings[i] = new string(
                Enumerable.Repeat("", length)
                .Select(_ => chars[random.Next(chars.Length)]).ToArray()
            );
        }
        return strings;
    }
}